Repository navigation
feat: Parse protocolFallbackTTL from FDv2 goodbye - #265
Merged
Merged
Conversation
Co-Authored-By: Bee Klimt <bklimt@launchdarkly.com>
Co-Authored-By: Bee Klimt <bklimt@launchdarkly.com>
This reverts commit 8801336.
Co-Authored-By: Bee Klimt <bklimt@launchdarkly.com>
Contributor
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
There was a problem hiding this comment.
Risk: low.
Automated risk review (dry run): Low
This PR would be automatically approved.
Why: It adds optional protocolFallbackTTL parsing on FDv2 Goodbye and pass-through in FDv2ProtocolHandler, with tests for absent, numeric, and malformed values. There are no infrastructure, auth, or approval-policy changes.
If you disagree with this review, share this PR in #feedback-agent-approvals or submit a changes-requested review explaining why.
Sent by Cursor Approval Agent: Dry-Run PR Approver
beekld
commented
Nov 17, 2026
Co-Authored-By: Bee Klimt <bklimt@launchdarkly.com>
tanderson-ld
approved these changes
Nov 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Parses the optional
protocolFallbackTTLfield of the FDv2goodbyepayload inlaunchdarkly-java-sdk-internal, so the server SDK can treat it as an FDv1 fallback directive.Part of SDK-2987.
Goodbye.getProtocolFallbackTTL()andFDv2ActionGoodbye.getProtocolFallbackTTL()return a nullableDuration:nullwhen the field is absent or JSONnull, the value in seconds when it is a number, andDuration.ZEROwhen it is present but not a number.Duration.ZEROworks as "use the default TTL", because the spec already treats 0 that way (DATASYSTEM 1.6.1.3–1.6.1.5). A malformed TTL still counts as a directive.Implementation details
TypeAdapteronGoodbye.protocolFallbackTTLis needed because existing tests round-tripGoodbyethrough Gson, and Gson can't reflect intojava.time.Durationon JDK 17.parse()reuses the adapter's read logic.ZERO) and JSONnull(→ absent), plus pass-through inFDv2ProtocolHandler../gradlew test checkstyleMain checkstyleTestinlib/shared/internal.Link to Devin session: https://app.devin.ai/sessions/cce64c67519f4babaa75176c06961c5e
Open in Devin Desktop: https://app.devin.ai/desktop/session/cce64c67519f4babaa75176c06961c5e?variant=devin
Requested by: @beekld
Note
Overview
Adds optional
protocolFallbackTTLto the FDv2Goodbyepayload and threads it throughFDv2ProtocolHandler.FDv2ActionGoodbye, so callers can read a server-directed FDv1 fallback delay on disconnect.Parsing treats absent or JSON
nullas null, numeric values as seconds (fractional supported), and non-numbers asDuration.ZERO(spec: use default TTL). A custom GsonFallbackTTLAdapterhandles round-trip serialization forDurationon JDK 17. One-arg constructors remain for backward compatibility.Tests cover TTL edge cases in
Goodbye.parseand pass-through fromhandleEvent.Reviewed by Cursor Bugbot for commit b7d1577. Bugbot is set up for automated code reviews on this repo. Configure here.